package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.GoodsPurchaseDetailMapper;
import com.ruoyi.domain.GoodsPurchaseDetail;
import com.ruoyi.service.IGoodsPurchaseDetailService;

/**
 * 采购订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-13
 */
@Service
public class GoodsPurchaseDetailServiceImpl implements IGoodsPurchaseDetailService 
{
    @Autowired
    private GoodsPurchaseDetailMapper goodsPurchaseDetailMapper;

    /**
     * 查询采购订单明细
     * 
     * @param purchaseDetailId 采购订单明细主键
     * @return 采购订单明细
     */
    @Override
    public GoodsPurchaseDetail selectGoodsPurchaseDetailByPurchaseDetailId(Long purchaseDetailId)
    {
        return goodsPurchaseDetailMapper.selectGoodsPurchaseDetailByPurchaseDetailId(purchaseDetailId);
    }

    /**
     * 查询采购订单明细列表
     * 
     * @param goodsPurchaseDetail 采购订单明细
     * @return 采购订单明细
     */
    @Override
    public List<GoodsPurchaseDetail> selectGoodsPurchaseDetailList(GoodsPurchaseDetail goodsPurchaseDetail)
    {
        return goodsPurchaseDetailMapper.selectGoodsPurchaseDetailList(goodsPurchaseDetail);
    }

    /**
     * 新增采购订单明细
     * 
     * @param goodsPurchaseDetail 采购订单明细
     * @return 结果
     */
    @Override
    public int insertGoodsPurchaseDetail(GoodsPurchaseDetail goodsPurchaseDetail)
    {
        return goodsPurchaseDetailMapper.insertGoodsPurchaseDetail(goodsPurchaseDetail);
    }

    /**
     * 修改采购订单明细
     * 
     * @param goodsPurchaseDetail 采购订单明细
     * @return 结果
     */
    @Override
    public int updateGoodsPurchaseDetail(GoodsPurchaseDetail goodsPurchaseDetail)
    {
        return goodsPurchaseDetailMapper.updateGoodsPurchaseDetail(goodsPurchaseDetail);
    }

    /**
     * 批量删除采购订单明细
     * 
     * @param purchaseDetailIds 需要删除的采购订单明细主键
     * @return 结果
     */
    @Override
    public int deleteGoodsPurchaseDetailByPurchaseDetailIds(Long[] purchaseDetailIds)
    {
        return goodsPurchaseDetailMapper.deleteGoodsPurchaseDetailByPurchaseDetailIds(purchaseDetailIds);
    }

    /**
     * 删除采购订单明细信息
     * 
     * @param purchaseDetailId 采购订单明细主键
     * @return 结果
     */
    @Override
    public int deleteGoodsPurchaseDetailByPurchaseDetailId(Long purchaseDetailId)
    {
        return goodsPurchaseDetailMapper.deleteGoodsPurchaseDetailByPurchaseDetailId(purchaseDetailId);
    }
}
